.MODEL small ;one data, one code segment, stack and data segment are grouped
.STACK 1024 ;stack, 1024 bytes

;--- macro's
	MPrintString macro string
		mov ah,09h
			mov dx,offset string
		int 21h
	endm
	
.DATA ;data segment, static variables
;--- constants
	stringlength = 10	
;--- variables
	mystring1 db "abcdefghij$"
	mystring2 db stringlength dup(?)
	endl db 0Ah,0Dh,"$"
	
.CODE ;code segment
.STARTUP ; start main, sets ds to beginning of data segment, updates ss to ds and adjusts sp acordingly
	
	; copy the values from mystring1 to mystring2
	mov dx,ds			; mov es,ds is not allowed!
	mov es,dx			; es points to the data segment
	cld					; the direction flag is cleared, strings will be processed from head to tail
	lea si,mystring1	; si contains the start adres of mystring1 (source)
	lea di,mystring2	; di contains the start adres of mystring2 (destination)
	mov cx,stringlength	; the hole string will be copied
	rep movsb			; these statements will copy a value from si to di cx times
	
	
	; printing results
	MPrintString mystring1
	MPrintString endl
	MPrintString mystring2
	MPrintString endl
.EXIT ; end main/exit to dos

;--- procedures


END 
